import { Rule, RuleType } from '@midwayjs/validate';
import { ApiProperty } from '@midwayjs/swagger';
import { BaseError as R } from '../../../common/base.error';
import { requiredString } from '../../../common/common.validate.rules';
import { StoreManageEntity } from '../entity/storeManage';
import { BaseDTO } from '../../../common/base.dto';

export class StoreManageDTO extends BaseDTO<StoreManageEntity> {
  @ApiProperty({
    description: '门店名称',
  })
  @Rule(requiredString.error(R.validateError('门店名称不能为空')))
  name?: string;

  @ApiProperty({
    description: '门店位置',
  })
  @Rule(requiredString.error(R.validateError('门店位置不能为空')))
  address?: string;

  @ApiProperty({
    description: '门店房间数',
  })
  @Rule(RuleType.allow(null))
  roomCount?: number;

  @ApiProperty({
    description: '门店大小',
  })
  @Rule(RuleType.allow(null))
  size?: string;

  @ApiProperty({
    description: '门店剩余房间数',
  })
  @Rule(RuleType.allow(null))
  freeRoomCount?: number;

  @ApiProperty({
    description: '备注',
  })
  @Rule(RuleType.allow(null))
  remark?: string;

  @ApiProperty({
    description: '联系电话',
  })
  @Rule(RuleType.allow(null))
  phone?: string;

  @ApiProperty({ description: '管理角色' })
  users: any[];
}